<?php
// *** Tangra (Application Framework and Tools for PHP)
// $Id$
//

require_once(TANGRA_MAIN_DIR.'db/db_config_loader_file.class.php');
require_once(TANGRA_MAIN_DIR.'db/db_config.class.php');

require_once($PATHS->get_hidden().'inc/modules/web_site_strawberry/web_site_strawberry_config_loader_file.class.php');


class Web_Site_Chocolate_Config_Loader_File extends Web_Site_Strawberry_Config_Loader_File {
	protected $db_fl;

	public function load_site_config(Web_Site_Config $WSC, $params) {
		parent::load_site_config($WSC, $params);

		if (array_key_exists('db_conf_file', $params)) {
			$db_fl = new DB_Config_Loader_File($params['db_conf_file']);
			$this->db_fl = $db_fl;
		} else {
			throw new TE_Web_Site_Config_Error('$params parameter does not contain key "db_conf_file"');
		}


		$db_config =  new DB_Config();
		$this->db_fl->load_db_config($db_config);

		$WSC->set_db_config($db_config);
	}
}


